namespace Management.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class createManufacturing : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Manufacturings",
                c => new
                    {
                        ManufacturingID = c.Int(nullable: false, identity: true),
                        Name = c.String(nullable: false),
                        perfix = c.String(),
                    })
                .PrimaryKey(t => t.ManufacturingID);
            
            CreateIndex("dbo.Workshops", "ManufacturingID");
            AddForeignKey("dbo.Workshops", "ManufacturingID", "dbo.Manufacturings", "ManufacturingID", cascadeDelete: true);
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.Workshops", "ManufacturingID", "dbo.Manufacturings");
            DropIndex("dbo.Workshops", new[] { "ManufacturingID" });
            DropTable("dbo.Manufacturings");
        }
    }
}
